#ifndef PAGEJUMP_H
#define PAGEJUMP_H

#include <QMap>
#include <QObject>
#include <QStackedWidget>
#include <QVBoxLayout>
#include <QWidget>

#include "factorymodel.h"

class PageJump : public QObject
{
    Q_OBJECT
public:
    explicit PageJump(QObject *parent = nullptr);

    void home(bool isAdmin = false);

    void setPage(const QString &page);

    QWidget* getPage(const QString& page);

    //---------------
    QWidget *pTopUser() const;
    void setPTopUser(QWidget *newPTopUser);

    QWidget *pTopAdmin() const;
    void setPTopAdmin(QWidget *newPTopAdmin);

    QVBoxLayout *getLayout() const;
    void setLayout(QVBoxLayout *newLayout);

    QString qss();

    QWidget *getConterWgt() const;
    void setConterWgt(QWidget *newConterWgt);

signals:


private:
//    QStackedWidget* m_pWgt;
    QWidget* m_pTopUser;
    QWidget* m_pTopAdmin;

    QMap<QString,QWidget*> m_subPage;
    QVBoxLayout* layout = nullptr;
    QWidget* conterWgt = nullptr;

    FactoryModel factory;
};

#endif // PAGEJUMP_H
